package Demo1;

public class T1 {
    /*
    * 获取class对象的三种方式
    * 1.Class .forName   最为常用
    * 2.类名.class    一般都是当做参数进行传递
    * 3.对象.getClass()   有类的对象时 才能使用
    */
    public static void main(String[] args) throws ClassNotFoundException {
        Class<?> aClass = Class.forName("Demo1.Student");
        Class<Student> aClass1 = Student.class;
        System.out.println(aClass1 == aClass);
        Student student = new Student();
        Class<? extends Student> aClass2 = student.getClass();
        System.out.println(aClass1 == aClass2);
    }
}
